package com.eascs.web.demo.view;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eascs.site.controller.BaseViewController;
import com.eascs.site.view.MessageRestResult;
import com.eascs.site.view.ViewContext;
import com.eascs.web.p3p.P3pHeader;

@Controller
public class SampleViewController extends BaseViewController {

	@RequestMapping(value = "/demo/view/", method = RequestMethod.GET)
	public String index() {
		ViewContext.put("k1", "v1");
		return "sample";
	}

	@RequestMapping(value = "/demo/view/p3p", method = RequestMethod.GET)
	@P3pHeader
	public String p3p() {
		ViewContext.put("k1", "v1");
		return "sample";
	}

	@RequestMapping(value = "/demo/view/result/exception", method = RequestMethod.GET)
	public MessageRestResult warnmessageexception() {
		throw new RuntimeException("warnmessageexception");
	}

}